<% title "Sign up" %>

<p>Already have an account? <%= link_to "Log in", login_path %>.</p>

<% form_for @user do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :username %><br />
    <%= f.text_field :username %>
  </p>
  <p>
    <%= f.label :email, "Email Address" %><br />
    <%= f.text_field :email %>
  </p>
  <p>
    <%= f.label :password %><br />
    <%= f.password_field :password %>
  </p>
  <p>
    <%= f.label :password_confirmation, "Confirm Password" %><br />
    <%= f.password_field :password_confirmation %>
  </p>
  <p>
    <%= f.label :roles %><br />
    <% for role in User::ROLES %>
      <%= check_box_tag "user[roles][]", role, @user.roles.include?(role) %>
      <%=h role.humanize %><br />
    <% end %>
    <%= hidden_field_tag "user[roles][]", "" %>
  </p>
  <p><%= f.submit "Sign up" %></p>
<% end %>
